# It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Desktop Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description - Script to set DNS of a network service # Parameters - "" "" # Configuration Type - COMPUTER # eg : networksetup -setdnsservers AirPort 8.8.8.8 , here pass Airport and 8.8.8.8 as the parameters if [ $# == '2' ]; then networksetup -setdnsservers $1 $2 ret=$? if [ $ret == "0" ]; then echo "DNS set Successfully" else echo "Error in DNS IP change" fi exit $ret else echo "Invalid Arguments - Please refer description of the script" exit 1 fi